package com.sinosoft.ebusiness.domain.elementManage;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.sinosoft.ebusiness.domain.elementManage.GeProductKindCalcute;
import com.sinosoft.ebusiness.domain.elementManage.GeProductPremiumCalcuteFormulaId;

@Entity
@Table(name = "GE_PREMIUM_CALCUTE_FORMULA")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
public class GeProductPremiumCalcuteFormula implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7259138700722794192L;

	/**
	 * 
	 */
	
	private String itemType;
	
	private String caclType;
	
	private Integer priority;
	
	private Integer coefficient;
	
	private String groupCode;
	
	private String processCode;
	
	private GeProductPremiumCalcuteFormulaId id;
	
	private GeProductKindCalcute geProductKindCalcute;

	@Column(name = "ITEMTYPE")
	public String getItemType() {
		return itemType;
	}

	public void setItemType(String itemType) {
		this.itemType = itemType;
	}

	@Column(name = "CACLTYPE")
	public String getCaclType() {
		return caclType;
	}

	public void setCaclType(String caclType) {
		this.caclType = caclType;
	}

	@Column(name = "PRIORITY")
	public Integer getPriority() {
		return priority;
	}

	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	@Column(name = "COEFFICIENT")
	public Integer getCoefficient() {
		return coefficient;
	}

	public void setCoefficient(Integer coefficient) {
		this.coefficient = coefficient;
	}

	@Column(name = "GROUPCODE")
	public String getGroupCode() {
		return groupCode;
	}

	public void setGroupCode(String groupCode) {
		this.groupCode = groupCode;
	}

	@Column(name = "PROCESSCODE")
	public String getProcessCode() {
		return processCode;
	}

	public void setProcessCode(String processCode) {
		this.processCode = processCode;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "PRODUCTCODE", column = @Column(name = "PRODUCTCODE")),
			@AttributeOverride(name = "VERSION", column = @Column(name = "VERSION")),
			@AttributeOverride(name = "ORDERNO", column = @Column(name = "ORDERNO")),
			@AttributeOverride(name = "ITEMCODE", column = @Column(name = "ITEMCODE")),
			@AttributeOverride(name = "KINDCODE", column = @Column(name = "KINDCODE"))})
	public GeProductPremiumCalcuteFormulaId getId() {
		return id;
	}

	public void setId(GeProductPremiumCalcuteFormulaId id) {
		this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "PRODUCTCODE", referencedColumnName = "PRODUCTCODE",insertable = false, updatable = false),
			@JoinColumn(name = "VERSION", referencedColumnName = "VERSION",insertable = false, updatable = false),
			@JoinColumn(name = "KINDCODE", referencedColumnName = "KINDCODE",insertable = false, updatable = false)})
	@JsonBackReference
	public GeProductKindCalcute getGeProductKindCalcute() {
		return geProductKindCalcute;
	}

	public void setGeProductKindCalcute(GeProductKindCalcute geProductKindCalcute) {
		this.geProductKindCalcute = geProductKindCalcute;
	}

	

}
